package com.example.boot.modules.marketing.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.example.starter.mybatis.anntation.CreatedBy;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 轮播项
 * </p>
 *
 * @author 王令
 * @since 2024-02-27
 */
@Data
@Accessors(chain = true)
@TableName("marketing_carousel_item")
public class CarouselItem {

    /**
     * 主键
     */
    @TableId(
            value = "id",
            type = IdType.AUTO
    )
    private Long id;

    /**
     * 轮播主键
     */
    @TableField("carousel_id")
    private Long carouselId;

    /**
     * 标语
     */
    @TableField("slogan")
    private String slogan;

    /**
     * 链接
     */
    @TableField("url")
    @NotBlank(message = "url不能为空")
    @URL(message = "url格式不正确")
    private String url;

    /**
     * 背景色
     */
    @TableField("bg_color")
    private String bgColor;

    /**
     * 跳转路由
     */
    @TableField("path")
    private String path;

    /**
     * 排序
     */
    @TableField("sort")
    private Integer sort;

    /**
     * 启用
     */
    @TableField("enabled")
    private Boolean enabled;

    /**
     * 创建人
     */
    @CreatedBy
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;


}
